<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>task_new</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<link rel="stylesheet" href="css/style.css" />
	<link rel="stylesheet" href="css/jquery-ui-1.10.1.custom.css"/>
	<link rel="stylesheet" href="css/select2.css"></link>
	<style type="text/css">
		body{
			font: 62.5% "Trebuchet MS", sans-serif;
			margin: 50px;
		}
		.demoHeaders {
			margin-top: 2em;
		}
		#dialog-link {
			padding: .4em 1em .4em 20px;
			text-decoration: none;
			position: relative;
		}
		#dialog-link span.ui-icon {
			margin: 0 5px 0 0;
			position: absolute;
			left: .2em;
			top: 50%;
			margin-top: -8px;
		}
		#icons {
			margin: 0;
			padding: 0;
		}
		#icons li {
			margin: 2px;
			position: relative;
			padding: 4px 0;
			cursor: pointer;
			float: left;
			list-style: none;
		}
		#icons span.ui-icon {
			float: left;
			margin: 0 4px;
		}
		.fakewindowcontain .ui-widget-overlay {
			position: absolute;
		}
	</style>
</head>
<body>
	<div class="container">
		<!--header start-->
		<div class="header">
			<h1 class="logo"><a href="">项目管理系统</a></h1>
		</div>
		<!--header end-->
		<div class="content">
			<div class="row">
				<div class="span9">
					<div class="list">
						<span style="font-size:1.2em"><i class="icon-hand-right"></i>添加新任务</span>
					</div>
					<div class="newproduct">
						<form class="form-horizontal" action="addtask.jspx" method="post" id="myform" autocomplete="off">
							<div class="control-group">
								<label class="control-label">任务名称</label>
								<div class="controls">
									<input type="text" name="taskname" class="span5 {required:true,messages:{required:'请输入任务名称'}}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">开始时间</label>
								<div class="controls">
									<input type="text" id="starttime" class="span5 {required:true,dateISO:true,messages:{required:'请输入开始时间',dateISO: '请输入合法的日期 .'}}" name="starttime">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">截止时间</label>
								<div class="controls">
									<input type="text" id="endtime" class="span5 {required:true,dateISO:true,messages:{required:'请输入截止时间',dateISO: '请输入合法的日期 .'}}" name="endtime">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="inputPassword">任务描述</label>
								<div class="controls">
									<textarea rows="6"  class="span5 {required:true,messages:{required:'请输入任务描述'}}" name="taskdesc"></textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="inputPassword">状态</label>
								<div class="controls">
									<select name="taskstate" id="e1" style="width:350px" class="{required:true,messages:{required:'状态不能为空'}}">
										<option value="">--请选择状态--</option>
										<option value="新任务">新任务</option>
										<option value="进行中">进行中</option>
										<option value="已完成">已完成</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="inputPassword">级别</label>
								<div class="controls">
									<select name="tasklevel" id="level" style="width:350px" class="{required:true,messages:{required:'级别不能为空'}}">
										<option value="">--请选择级别--</option>
										<option value="重要紧急">重要紧急</option>
										<option value="重要不紧急">重要不紧急</option>
										<option value="紧急不重要">紧急不重要</option>
										<option value="不紧急不重要">不紧急不重要</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="inputPassword">负责人</label>
								<div class="controls">
									<select name="manager" id="manager" style="width:350px" class="{required:true,messages:{required:'负责人不能为空'}}">
										<option value="">--请选择负责人--</option>
										<c:forEach items="${requestScope.list }" var="employee">
											<option value="${employee.id }">${employee.name }</option>
										</c:forEach>
									</select>
								</div>
							</div>
							<input class="hide" id="goalid" value="${sessionScope.curr_goal.id}">
							<div class="form-actions">
								<button type="button" class="btn btn-primary" id="save">保存</button>
								<button type="button" class="btn" id="return">返回</button>
							</div>
						</form>
					</div>
				</div>
				<div class="span3"></div>
			</div>
		</div>
		<div class="footer">
			<p>Copyright © 2013 xxx版权所有</p>
		</div>
	</div>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script src="js/jquery-1.9.1.js"></script>
	<script src="js/jquery-ui-1.10.1.custom.js"></script>
	<script src="js/jquery.ui.datepicker-zh-CN.min.js"></script>
	<script type="text/javascript" src="js/select2.js"></script>
	<script type="text/javascript" src="js/jquery.validate.min.js"></script>
	<script type="text/javascript" src="js/jquery.metadata.js"></script>
	<script type="text/javascript">
	$(function(){
		$("#myform").validate();
		$("#e1").select2();
		$("#level").select2();
		$("#manager").select2();
		$("#starttime").datepicker();
		$("#endtime").datepicker();
		$("#save").click(function(){
			$(".form-horizontal").submit();
		});	
		$("#return").click(function(){
			var id = $("#goalid").val();
			window.location="tasklist.jspx?id="+id;
		});	
	
	});
		
	</script>
</body>
</html>